using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using LeisureCenter.Api;
using LeisureCenter.Controls;

namespace LeisureCenter.Forms
{
    public partial class VirtualKeyboardDialog : DialogControl
    {
        public VirtualKeyboardDialog()
        {
            InitializeComponent();
        }

        public static bool Execute(string title, ref string text)
        {
            VirtualKeyboardDialog keyboard = new VirtualKeyboardDialog();
            using (keyboard)
            {
                keyboard.Title = title;
                keyboard.virtualKeyboard1.Text = text;
                bool result = keyboard.Execute();
                if (result)
                    text = keyboard.virtualKeyboard1.Text;
                return result;
            }
        }

        public override void SetFocusHandlers(IFocusHandler okButton, IFocusHandler cancelButton)
        {
            virtualKeyboard1.Down = okButton;
        }
    }
}